#include"head.h"



int main()
{
	Addr addr(6666);
	int lisfd=get_lis_socket(addr);
	assert(lisfd>0);
	
	event_base *base=event_base_new();
	assert(base!=NULL);
	
	struct event* ev_listen = event_new(base, lisfd, EV_READ | EV_PERSIST | EV_ET,apt_func, base);
	assert(ev_listen!=NULL);  //创建监听套接字可读事件，调用apt_func函数
	
	event_add(ev_listen, NULL); //注册到循环
	
	event_base_dispatch(base);
	
	event_base_free(base);
}


